package system.commodityManagement.impl;

/**
 * Created by 陈文杰 on 2022/4/13 21:27
 */

/*
商品类
保存和获取商品属性
 */
public class Commodity {
    private int id;//商品编号
    private String name;//商品名称
    private double price;//商品价格
    private int count;//商品数量

    @Override
    public String toString() {
        return "Commodity{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", price=" + price +
                ", count=" + count +
                '}';
    }

    public String printCommodity(){
        return id+" "+name+" ¥"+price+" 数量"+count;
    }
    public int getCount() {
        return count;
    }

    public void setCount(int count) {
        this.count = count;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }
}
